package immutable;

/**
 * @Classname FinalMethodDemo
 * @Description TODO
 * @Date 2025/1/8 22:36
 * @Author zhuzhenguo
 */
public class FinalMethodDemo {


    public void drink() {

    }

    public final void eat() {

    }

    public static void sleep() {

    }
}

class SubClass extends FinalMethodDemo {

    @Override
    public void drink() {
        super.drink();
        eat();
    }

    //    public final void eat() {
//
//    }

    /**
     * static方法在创建类的时候就确定下来，和父类无关，只和子类绑定
     */
    public static void sleep() {

    }

}
